package org.example.service.impl;


import org.example.mapper.UserMapper;
import org.example.pojo.AddUser;
import org.example.pojo.User;
import org.example.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired  //注入的是代理对象的实例
    private UserMapper userMapper;

    @Override
    public List<User> selectUsers(){
        return userMapper.selectUsers();
    }

    @Override
    public User selectUserByNo(String No) {

        return userMapper.selectUserByNo(No);
    }

    @Override
    public int updateUserPwd(User user) {
        return  userMapper.updateUserPwd(user);
    }

    @Override
    public  User selectUserByNameAndPwd(User user){

        return  userMapper.selectUserByNameAndPwd(user);

    }

    @Override
    public List<User> selectVariablesByAll(String var) {
        return userMapper.selectVariablesByAll(var);
    }

    @Override
    public int addRole(AddUser user) {
        return userMapper.addUser(user);
    }

    @Override
    public int deleteUser(int id) {
        return userMapper.deleteUser(id);
    }

    @Override
    public User selectUserById(int mId) {
        return userMapper.selectUserById(mId);
    }
}
